import { Map } from "immutable"

import * as actionTypes from './constants'

const defaultState = Map({
  topBanners: [],
  hotRecommend: [],
  newAlbum: [],
})


function reducer(state = defaultState, action) {
  console.log('132132132131232131------');
  switch (action.type) {
    case actionTypes.CHANGE_TOP_BNNAER:
      return state.set('topBanners', action.banners);
    case actionTypes.CHANGE_HOT_RECOMMEND:
      return state.set('hotRecommend', action.list)
    case actionTypes.CHANGE_NEW_ALBUM:
      return state.set('newAlbum', action.data)
    default:
      return state
  }
}

export default reducer